package wsi.gui.resolve;

import org.rygh.gui.model.presenter.FPresenter;
import org.rygh.gui.view.BorderView;
import org.rygh.gui.view.one.OneTableView;
import org.rygh.gui.view.one.OneTreeView;

import wsi.gui.resolve.model.FunctionStatTuple;
import wsi.gui.resolve.model.FunctionTreeNode;

public class ResolveView extends BorderView {

	private final ResolveTopView topView;
	private final OneTreeView<String> treeView;
	private final OneTableView<FunctionStatTuple> tableView;

	public ResolveView(FPresenter presenter) {
		super(presenter);

		topView = new ResolveTopView(presenter);
		treeView = new OneTreeView<>(presenter);
		tableView = new OneTableView<>(presenter);

		init();
	}

	public OneTableView<FunctionStatTuple> getTableView() {
		return tableView;
	}

	public ResolveTopView getTopView() {
		return topView;
	}

	public OneTreeView<String> getTreeView() {
		return treeView;
	}

	private void init() {
		FunctionTreeNode root = FunctionTreeNode.build();
		treeView.getTree().setRoot(root);
		treeView.getView().setPrefWidth(200);

		setTop(topView);
		setLeft(treeView);
		setCenter(tableView);
	}
}
